package palette;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import actionHandlers.ArbShapeDialogBox;
import cuShapes.PQLine;
import cuShapes.PQShape;
//import cuShapes.ArbShape;

/**
 * This class contains the declarations for the BuilderWindow used when
 * the user tries to draw a new shape.
 */

public class BuilderWindow extends CanvasWindow implements ActionListener {
	
	JMenuBar menuBar;
	JMenu menu;
	JMenuItem item;
	/**
	 * 
	 */
	private static final long serialVersionUID = 279530650225523245L;
	
	JPanel myPanel = new JPanel();
	public BuilderWindow(String name){
		super(name);
		
		menuBar = new JMenuBar();
		
		menu = new JMenu("File");
		
		item = new JMenuItem("Save Shape");
		item.getAccessibleContext().setAccessibleDescription("Save the Current Shape");
		item.addActionListener(this);
		menu.add(item);
		
		menuBar.add(menu);
		
		setJMenuBar(menuBar);	
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		ArrayList<PQLine> aList = new ArrayList<PQLine>();
		for(PQShape shape : shapeList){
			for(PQLine line : shape.getLineList()){
				aList.add(line);
			}
		}
		
		//ArbShape s = new ArbShape(aList);
		ArbShapeDialogBox box = new ArbShapeDialogBox();
		box.showDialog();
	}
	
	
	
	
}
